#include "game_server.h"
#include "wrap_directinputeffect.h"

int WrapperDirectInputEffect::GetID(){
	return this->id;
}

void WrapperDirectInputEffect::SetID(int id){
	this->id = id;
}

WrapperDirectInputEffect::WrapperDirectInputEffect(IDirectInputEffect *ptr,int _id){
	Log::log("WrapperDirectInputEffect::Constuctotr() called!\n");
	this->m_ie = ptr;
	this->id = _id;
}

/* Unknown methods */
STDMETHODIMP WrapperDirectInputEffect::QueryInterface(THIS_ REFIID riid,void **ppvObj){
	Log::log("WrapperDirectInputEffect::QueryInterface() called!\n");
	HRESULT hr = m_ie->QueryInterface(riid,ppvObj);
	*ppvObj = this;
	return hr;
}

STDMETHODIMP_(ULONG) WrapperDirectInputEffect::AddRef(THIS){
	Log::log("WrapperDirectInputEffect::AddRef() called !\n");
	return this->m_ie->AddRef();
}

STDMETHODIMP_(ULONG) WrapperDirectInputEffect::Release(THIS){
	Log::log("WrapperDirectInputEffect::Release() called\n");
	return this->m_ie->Release();
}

/* IDirectInputEffect methods*/
STDMETHODIMP WrapperDirectInputEffect::Download(THIS){
	Log::log("WrapperDirectInputEffect::DownLoad() called!\n");
	return this->m_ie->Download();
}
STDMETHODIMP WrapperDirectInputEffect::Escape(THIS_ LPDIEFFESCAPE pesc){
	Log::log("WrapperDirectInputEffect::Escape() called!\n");
	return this->m_ie->Escape(pesc);
}

STDMETHODIMP WrapperDirectInputEffect::GetEffectGuid(THIS_ LPGUID pguid){
	Log::log("WrapperDirectInputEffect::GetEffetGuid() called!\n");
	return this->m_ie->GetEffectGuid(pguid);
}

STDMETHODIMP WrapperDirectInputEffect::GetEffectStatus(THIS_ LPDWORD pdwFlags){
	Log::log("WrapperDirectInputEffect::GetEffectStatus() called!\n");
	return this->m_ie->GetEffectStatus(pdwFlags);
}

STDMETHODIMP WrapperDirectInputEffect::GetParameters(THIS_ LPDIEFFECT peff,
		DWORD dwFlags){
			Log::log("WrapperDirectInputEffect::GetParameters() called!\n");
			return this->m_ie->GetParameters(peff,dwFlags);
}

STDMETHODIMP WrapperDirectInputEffect::Initialize(THIS_ HINSTANCE hinst,
		DWORD dwVersion,
		REFGUID rguid){
			Log::log("WrapperDirectInputEffect::Initalize() called!\n");
			return this->m_ie->Initialize(hinst,dwVersion,rguid);
}

STDMETHODIMP WrapperDirectInputEffect::SetParameters(THIS_ LPCDIEFFECT peff, DWORD dwFlags){
			Log::log("WrapperDirectInputEffect::SetParameters() called!\n");
			return this->m_ie->SetParameters(peff,dwFlags);
}

STDMETHODIMP WrapperDirectInputEffect::Start(THIS_ DWORD dwIterations, DWORD dwFlags){
			Log::log("WrapperDirectInputEffect::Start() called!\n");
			return this->m_ie->Start(dwIterations,dwFlags);
}

STDMETHODIMP WrapperDirectInputEffect::Stop(THIS){
	Log::log("WrapperDirectInputEffect::Stop() called!\n");
	return this->m_ie->Stop();
}

STDMETHODIMP WrapperDirectInputEffect::Unload(THIS){
	Log::log("WrapperDirectInputEffect::Unload() called!\n");
	return this->m_ie->Unload();
}
